<?php
namespace jianan\controllers;

use Yii;
use yii\web\Controller;
use yii\data\Pagination;
use jianan\models\Cus;
use jianan\models\Master;
use yii\db\Query;
header("Content-type:text/html;charset=utf-8");
/*
* 销售情况统计
*/

class ManageController extends Controller {

	public function actionFinance(){

		return $this->render('finance');
	}

	public function actionApproval(){
		$model = new Cus;
		$query = Cus::find();
		$model = $query->where(["approval"=>1])->orderBy(['id'=> SORT_DESC])->all();

		foreach($model as $k => $v){
			$mastername = Master::findOne($v['sid']);
			$v['sid'] = isset($mastername['masterName']) ? $mastername['masterName'] : "无";
		}
		$gender = [1=>'男',2=>'女'];
		$data = Cus::$data;

		return $this->render('approval',['model'=>$model,'pages'=>$pages,'gender'=>$gender,'data'=>$data]);
	}

	public function actionAgree(){
		
	}
}
